<?php include template("header");?>
<script type="text/javascript" src="/static/js/vote.js"></script>
<div id="bdw" class="bdw">
<div id="bd" class="cf">

<div id="user-vote">
	<div id="content">
        <div class="box clear">
			<div class="box-top"></div>
			<div class="box-content">
				<div class="head">
					<h2>user survey</h2>
				</div>
				<div class="sect">
					<p class="welcome">Answer several questions，your would be better serviced <?php echo $INI['system']['abbreviation']; ?>！</p>
					<form method="post" action="/vote/add.php" onsubmit="return vote_submit(this);">
						<ol class="vote-list">
							<?php if(!$question_list){?>
								no survey
							<?php }?>

<?php if(is_array($question_list)){foreach($question_list AS $num=>$question) { ?>
	<li id="vote-list-<?php echo $num; ?>">
		<h4 id="title<?php echo $question['id']; ?>"><?php echo $num+1; ?>、<?php echo $question['title']; ?></h4>
		<div class="choices">
			<?php if(is_array($question['options_list'])){foreach($question['options_list'] AS $index=>$options) { ?>
				<input type="<?php echo $question['type']; ?>" value="<?php echo $options['id']; ?>" id="label-<?php echo $question['id']; ?>-<?php echo $options['id']; ?>" name="vote<?php echo $question['id']; ?>[]" class="choice"/>
				<label class="text" for="label-<?php echo $question['id']; ?>-<?php echo $options['id']; ?>"><?php echo $options['name']; ?></label>
				<?php if($options['is_input']){?>
					<input type="text" class="f-text" name="input<?php echo $options['id']; ?>" id="input<?php echo $options['id']; ?>" onfocus="document.getElementById('label-<?php echo $question['id']; ?>-<?php echo $options['id']; ?>').checked = true;" onblur="document.getElementById('label-<?php echo $question['id']; ?>-<?php echo $options['id']; ?>').checked = this.value ? true : false;">
				<?php }?>
				<?php echo $options['is_br'] ? '<br>' : ''; ?>
			<?php }}?>
		</div>
	</li>
<?php }}?>






						</ol>
						<div class="commit"><input type="submit" class="formbutton" name="submit" value="Submit" /></div>
					</form>
				</div>
			</div>
			<div class="box-bottom"></div>
		</div>
	</div>
</div>

</div> <!-- bd end -->
</div> <!-- bdw end -->

<?php include template("footer");?>
